/*
 * BaseData.java
 *
 * Created on November 19, 2006, 1:09 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Comm.Net;

import javax.microedition.lcdui.Image;

/**
 *
 * @author dmgreen
 */
public class BaseData {
        
    
    
    public static String UNSENT    = "UNSENT";
    public static String SENT      = "SENT";
    public static String SENDING   = "SENDING";
    public static String FAILED    = "FAILED";
    
    public final static String MSGTYPE_LOG       = "LOG";
    public final static String MSGTYPE_SAMPLE    = "SAMPLE";
    public final static String MSGTYPE_TAG       = "TAG";
    public final static String MSGTYPE_FOLLOWUP  = "FOLLOWUP";
    
    private String myURL;
    private int myUID;
    
    // may be complex object as opposed to just a string. ??
    protected String myResponse = "";
    protected String myPayload = "";
    protected String myStatus = UNSENT;
    protected String myMsgType = "";
   
    private int myAttempts = 0;
    
    private long mySendTime = 0;
    
   
    
    public BaseData(String url, int uid) {
        myPayload = "";
              
        myURL = url;
        myUID = uid;
    }
     
    protected boolean myHasAttachments = false;
    
    public boolean getHasAttachments(){
        return myHasAttachments;
    }
    public void setHasAttachments(boolean multipart){
        myHasAttachments = multipart;
    }

    public int getAttempts() {
        return myAttempts;
    }
    
    public void incrementAttempts() {
        myAttempts++;
    }
    
    public String getPayload() {
        return myPayload;
    }
    
    public void setStatus(String status) {
        myStatus = status;
    }
    
    public String getStatus() {
        return myStatus;
    }
    
    public String getURL() {
        return myURL;
    }
    
    public void setResponse(String response) {
        myResponse = response;
    }
    
    // what did the server return?
    public String getResponse() {
        return myResponse;
    }
    
    public void setMsgType(String msg_type) {
        myMsgType = msg_type;
    }
    
    public String getMsgType() {
        return myMsgType;
    }

    public long getSendTime() {
        return mySendTime;
    }

    public void setSendTime(long send_time) {
        mySendTime = send_time;
    }

    public int getUID() {
        return myUID;
    }
}
